/**
 *
 * 懒加载动态路由
 */
function lazy(code) {
    //return  resolve => require(["@/components/" + name + ".vue"], resolve)
    return getComponetByPath('/' + code);

}

function getComponetByPath(path) {
    for(var i = 0; i < dynamicRouter.length; i++) {
        var route = dynamicRouter[i];
        if(route.path == path) {
            return route.component;
        }
    }
}
/**
 * 路由定义
 * path跟配置里的资源标示对应,同时跟url地址对应
 */
const dynamicRouter = [
    // {
    //   name: 'index',
    //   path: '/index',
    //   component: resolve => require(['@/components/index.vue'], resolve),
    //   meta: {
    //       title: '支付管理'
    //   }
    //  },
    //  {
    //      name: 'tollProject',
    //      path: '/tollProject',
    //      component: resolve => require(['@/components/tollProject.vue'], resolve),
    //      meta: {
    //          title: '收费项目'
    //      }
    //  },
    //  {
    //      name: 'payRecode',
    //      path: '/payRecode',
    //      component: resolve => require(['@/components/payRecode.vue'], resolve),
    //      meta: {
    //          title: '缴费记录'
    //      }
    //  },
    //  {
    //      name: 'packageManager',
    //      path: '/packageManager',
    //      component: resolve => require(['@/components/packageManager.vue'], resolve),
    //      meta: {
    //          title: '套餐管理'
    //      }
    //  }
]
export {
    lazy
}